package com.cfpl.admin_service.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cfpl.admin_service.VO.AvailableFertilizer;
import com.cfpl.admin_service.VO.AvailablePesticide;
import com.cfpl.admin_service.VO.PesticideDetails;
import com.cfpl.admin_service.service.PesticideAcquireRecordService;
import com.cfpl.project_common.pojo.PesticideAcquireRecord;
import com.cfpl.admin_service.mapper.PesticideAcquireRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author wrp
* @description 针对表【pesticide_acquire_record】的数据库操作Service实现
* @createDate 2023-10-24 17:02:43
*/
@Service
public class PesticideAcquireRecordServiceImpl extends ServiceImpl<PesticideAcquireRecordMapper, PesticideAcquireRecord>
    implements PesticideAcquireRecordService {

    @Autowired
    private PesticideAcquireRecordMapper pesAcquireRecordMapper;

    /**
     * 根据农药领取记录查询本次所有的农药使用记录
     * @param id 农药领取记录
     * @return 本次所有的农药使用记录
     */
    @Override
    public List<PesticideDetails> queryUsageRecordByAcquireRecord(Long id) {
        return pesAcquireRecordMapper.queryUsageRecordByAcquireRecord(id);
    }
    /**
     * 查询当前施农药人员可使用的农药信息列表
     * @param adminId 施农药人员编号
     * @return 可使用的农药信息列表
     */
    @Override
    public List<AvailablePesticide> queryAvailablePesticideList(Long adminId) {
        return pesAcquireRecordMapper.queryAvailablePesticideList(adminId);
    }
}




